<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        div {
            position: absolute;
            left: 50%;
            top: 50%;
            height: 0;
            width: 40%;
            padding-top: 20%;
            transform: translate(-50%, -50%);
            background-color: red;
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>